<!DOCTYPE html>
<html>
	<head>
		<title>降级申诉</title>
		<meta name="viewport" content="width=device-width, initial-scale=1 ,user-scalable=0"/>
		<link href="__STATIC__/traveller/css/DemotionAppeal.css" type="text/css" rel="stylesheet" />
		<link href="__STATIC__/traveller/css/bootstrap.min.css" rel="stylesheet"/>
		<script src="__STATIC__/traveller/js/jquery-3.3.1.min.js"></script>
	</head>
	<body>
		<div>
			<div class="top">
				<div id="vtitle" class="vtitle">
					<div class="rvt div-inline">申诉理由:</div>
				</div>
				<hr />
				<div class="vcontent">
					<textarea id="textBox" class="textBox" required="required" maxlength="100" placeholder="申诉理由" autofocus="autofocus"></textarea>
				</div>
				<div id="btnBox"><button id="btn" class="btn btn-success" onclick="submitAppealData()">提交</button></div>
			</div>
			
		</div>
		<script src="__STATIC__/traveller/js/introduce.js"></script>
		<script src="__STATIC__/traveller/js/bootstrap.min.js"></script>
	</body>
	{php} // dump(TOKEN);{/php}
	<script>
		function submitAppealData() {
			var token = "<?php echo $token; ?>";
			var user_id = "<?php echo $user_id; ?>";
			var val = $('#textBox').val();
			if (!val){
				return false;
			}
			if (!token){
				return false;
			}
			console.log('我的token是', token);
			console.log('我的user_id是', user_id);
			$.ajax({
				type: 'post',
				url: '/index/appeal/index',
				data: { user_id: user_id, token: token, reason: val},
				success: function (ret) {
					console.log('提交申诉理由', ret)
					if (ret.status) {
						alert(ret.message);
						location.reload();
					}
				},
				error: function (ret) {
					
				}
			});
		}
	</script>
</html>
